package com.parachutes.aspbillcore.controller;


import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import com.parachutes.aspbillapi.domain.Result;
import com.parachutes.aspbillapi.domain.SysWithdrawalRecord;
import com.parachutes.aspbillapi.service.SysWithdrawalRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("withdrawal_record")
public class SysWithdrawalRecordController {

    @Autowired
    private SysWithdrawalRecordService sysWithdrawalRecordService;

    @GetMapping("/list")
    public Result list(Integer page, Integer pageSize) {
        PageMethod.startPage(page, pageSize);
        List<SysWithdrawalRecord> list = sysWithdrawalRecordService.getWithdrawalRecordList();
        PageInfo<SysWithdrawalRecord> info = new PageInfo<>(list);
        return Result.of(true, "success", info);
    }
    @GetMapping("/recharge_list")
    public Result rechargeList(Integer page, Integer pageSize) {
        PageMethod.startPage(page, pageSize);
        List<SysWithdrawalRecord> list = sysWithdrawalRecordService.getRechargeRecordList();
        PageInfo<SysWithdrawalRecord> info = new PageInfo<>(list);
        return Result.of(true, "success", info);
    }
}
